import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 高生平
 * Date: 2025-09-13
 * Time: 20:37
 */
public class Test {
    public static void arrayReverse (int[] array) {
        int left = 0;
        int right = array.length - 1;
        while (left < right) {
            int tmp = array[left];
            array[left] = array[right];
            array[right] = tmp;
            left++;
            right--;
        }
    }
    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5};
        arrayReverse(array);
        System.out.println(Arrays.toString(array));
    }
}
